set seed 662607004
ssc install medsem, replace

/* 
Preparing data for analysis: lines 10-403
Performing factor analysis and creating predicted latent factor for analysis: lines 404-444
Creating marginal effect graphs for figure 1: lines 445-459.
*/

import excel "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 1.xlsx", sheet("Sheet1") firstrow clear

rename NeighborhoodInfluencer w1q1
label variable w1q1 "Currently, how often do you interact with your neighbors?"
replace w1q1="1" if w1q1=="Never"
replace w1q1="2" if w1q1=="Rarely"
replace w1q1="3" if w1q1=="Occasionally"
replace w1q1="4" if w1q1=="Frequently"
replace w1q1="99" if w1q1=="Unsure "

rename UninformedCOVIDThreat17 w1q2
label variable w1q2 "On a scale of 1 - 7, with 1 being the least severe and 7 being the most severe, how big of a threat to peoplesâ€™ health is COVID-19 in Georgia?"
replace w1q2="0" if w1q2=="COVID-19 is not a threat in Georgia"
replace w1q2="99" if w1q2=="Unsure "

rename COVIDExaggeration w1q3
label variable w1q3 "Do you think the threat of COVID-19 is being exaggerated or downplayed?"
replace w1q3="1" if w1q3=="Very downplayed"
replace w1q3="2" if w1q3=="Somewhat downplayed"
replace w1q3="3" if w1q3=="Neither exaggerated nor downplayed"
replace w1q3="4" if w1q3=="Somewhat exaggerated"
replace w1q3="5" if w1q3=="Very exaggerated"
replace w1q3="99" if w1q3=="Unsure "

rename COVIDComplicationsConcern w1q4
label variable w1q4 "How concerned are you that you or an immediate family member will get serious complications and or be hospitalized due to COVID-19?"
replace w1q4="1" if w1q4=="Very unconcerned"
replace w1q4="2" if w1q4=="Somewhat unconcerned"
replace w1q4="3" if w1q4=="Neither concerned nor unconcerned"
replace w1q4="4" if w1q4=="Somewhat concerned"
replace w1q4="5" if w1q4=="Very concerned"
replace w1q4="99" if w1q4=="Unsure "

rename COVIDHandling w1q5 
label variable w1q5 "Which of the following statements is closest to how you think Georgia should handle the COVID-19 pandemic?"
replace w1q5="1" if w1q5=="No public health measures are necessary"
replace w1q5="2" if w1q5=="All public health measures to keep people safe should be voluntary"
replace w1q5="3" if w1q5=="Some public health measures to keep people safe should be voluntary and someÂ â€“ such as wearing masks and social distancing in publicÂ â€“ should be mandatory"
replace w1q5="4" if w1q5=="All public health measures to keep people safe should be mandatory"
replace w1q5="99" if w1q5=="Unsure "

rename DontWorryifStrongImmuneSys w1q6
label variable w1q6 "People with strong immune systems do not need to worry about COVID-19"
replace w1q6="1" if w1q6=="Strongly disagree" 
replace w1q6="2" if w1q6=="Somewhat disagree"
replace w1q6="3" if w1q6=="Neither agree nor disagree"
replace w1q6="4" if w1q6=="Somewhat agree"
replace w1q6="5" if w1q6=="Strongly agree"
replace w1q6="99" if w1q6=="Unsure"

rename SameasFlu w1q7
label variable w1q7 "COVID-19 poses the same risk as the seasonal flu"
replace w1q7="1" if w1q7=="Strongly disagree" 
replace w1q7="2" if w1q7=="Somewhat disagree"
replace w1q7="3" if w1q7=="Neither agree nor disagree"
replace w1q7="4" if w1q7=="Somewhat agree"
replace w1q7="5" if w1q7=="Strongly agree"
replace w1q7="99" if w1q7=="Unsure"

rename COVIDVaccine w1q8 
label variable w1q8 "There will be a widely available vaccine for COVID-19 by the end of the year"
replace w1q8="1" if w1q8=="Strongly disagree" 
replace w1q8="2" if w1q8=="Somewhat disagree"
replace w1q8="3" if w1q8=="Neither agree nor disagree"
replace w1q8="4" if w1q8=="Somewhat agree"
replace w1q8="5" if w1q8=="Strongly agree"
replace w1q8="99" if w1q8=="Unsure"

rename DesiretoSociallyDistance w1q9
label variable w1q9 "During this pandemic, I wish people who are not a part of my household would stay at least six feet away from me"
replace w1q9="1" if w1q9=="Strongly disagree" 
replace w1q9="2" if w1q9=="Somewhat disagree"
replace w1q9="3" if w1q9=="Neither agree nor disagree"
replace w1q9="4" if w1q9=="Somewhat agree"
replace w1q9="5" if w1q9=="Strongly agree"
replace w1q9="99" if w1q9=="Unsure"

rename VaccineReaction w1q10
label variable w1q10 "Once a COVID-19 vaccine is available in the U.S., which of the following statements most closely matches what youâ€™ll do?"
replace w1q10="1" if w1q10=="I will not get the vaccine because COVID-19 is not a real danger"
replace w1q10="2" if w1q10=="I will get the vaccine eventually, but I’ll wait to make sure it is safe"
replace w1q10="3" if w1q10=="I will get the vaccine when I get around to it"
replace w1q10="4" if w1q10=="I will get the vaccine immediately"
replace w1q10="88" if w1q10=="I will not get the vaccine because I don’t think vaccines are safe in general"
replace w1q10="99" if w1q10=="Unsure "

rename FrequencyLargeGroupEvent w1q11
label variable w1q11 "In the past month, how many times have you attended a group event with more than 10 people in attendance, such as a religious gathering, party, funeral, wedding, sporting event, etc.?"
replace w1q11="1" if w1q11=="I have not attended a group event with more than 10 people in attendance in the past month"
replace w1q11="2" if w1q11=="1 - 2 times in the past month"
replace w1q11="3" if w1q11=="3 - 6 times in the past month"
replace w1q11="4" if w1q11=="7 - 10 times in the past month"
replace w1q11="5" if w1q11=="More than 10 times in the past month"
replace w1q11="99" if w1q11=="Unsure "

rename FrequencyMask w1q12
label variable w1q12 "When out in public and around people, how often do you wear a mask or face covering?"
replace w1q12="1" if w1q12=="Never"
replace w1q12="2" if w1q12=="Rarely"
replace w1q12="3" if w1q12=="Some of the time"
replace w1q12="4" if w1q12=="Most of the time"
replace w1q12="5" if w1q12=="Always"
replace w1q12="99" if w1q12=="Unsure "


// Responses to why people are not wearing masks

rename Otherpeopleintheareawereno NoMask1W1
rename Iwasconcernedaboutwhatother NoMask2W1
rename Masksareawkwarduncomfortable NoMask3W1
rename Maskscannotprotectmeorstop NoMask4W1
rename ThereislittleriskthatIcan NoMask5W1
rename MasksareunnecessarybecauseCO NoMask6W1
rename Idontcareabouttherisks NoMask7W1
rename Beingforcedtowearamaskviol NoMask8W1
rename Thegovernmentdoesntrequirem NoMask9W1
rename Iforgettobringamask NoMask10W1
rename Wearingamaskisagreaterthre NoMask11W1
rename Unsure NoMaskUnsureW1
rename Other NoMaskOtherW1

rename FrequencySocialDistance w1q14 
label variable w1q14 "When out in public and around people, how often do you socially distance by staying six or more feet away from others?"
replace w1q14="1" if w1q14=="Never"
replace w1q14="2" if w1q14=="Rarely"
replace w1q14="3" if w1q14=="Some of the time"
replace w1q14="4" if w1q14=="Most of the time"
replace w1q14="5" if w1q14=="Always"
replace w1q14="99" if w1q14=="Unsure "

// Responses to why people are not socially distancing

rename AA SocDis1W1
rename AB SocDis2W1
rename Sociallydistancingisawkwardu SocDis3W1
rename Sociallydistancingcannotprote SocDis4W1
rename AE SocDis5W1
rename Sociallydistancingisnotneces SocDis6W1
rename AG SocDis7W1
rename Beingforcedtosociallydistanc SocDis8W1
rename Thegovernmentdoesntrequires SocDis9W1
rename Iforgettosociallydistance SocDis10W1
rename AK SocDisUnsureW1
rename AL SocDisOtherW1

rename FrequencyEncourageMaskSoc w1q16
label variable w1q16 "How often do you ask or encourage your family or friends to wear a mask and/or stay six feet away from others for their own safety?"
replace w1q16="1" if w1q16=="Never"
replace w1q16="2" if w1q16=="Rarely"
replace w1q16="3" if w1q16=="Some of the time"
replace w1q16="4" if w1q16=="Most of the time"
replace w1q16="5" if w1q16=="Always"
replace w1q16="99" if w1q16=="Unsure "

rename HowManyinMasksSocialDista w1q17
label variable w1q17 "Generally, when you are in public, how many of the people around you are wearing masks and/or social distancing by staying at least six feet away from others?"
replace w1q17="1" if w1q17=="Practically no one"
replace w1q17="2" if w1q17=="Some people, but less than half"
replace w1q17="3" if w1q17=="Not everyone, but more than half"
replace w1q17="4" if w1q17=="Practically everyone"
replace w1q17="88" if w1q17=="I never go out"
replace w1q17="99" if w1q17=="Unsure "

rename ShoppingChange w1q18
label variable w1q18 "Which of the following statements most closely reflects how your shopping habits have changed due to COVID-19, if at all?"
replace w1q18="1" if w1q18=="I go to the store less often"
replace w1q18="2" if w1q18=="My shopping habits haven’t changed – I go to the store the same amount"
replace w1q18="3" if w1q18=="I go to the store more often"
replace w1q18="99" if w1q18=="Unsure "

// Responses to video
rename Seeingthathealthyyoungpeople VidResponse1W1
rename Hallucinationsamongpeoplewho  VidResponse2W1
rename Seeingthatpeoplewhodownplaye  VidResponse3W1
rename TheArmyGeneralsstatementsof  VidResponse4W1
rename Learningthatpeoplewhoworked  VidResponse5W1
rename Thedoctorsdescriptionofwhy  VidResponse6W1
rename Noneoftheabove  VidResponse7W1
rename AW  VidResponseUnsureW1
rename AX  VidResponseOtherW1

rename InformedCOVIDThreat17 w1q28
replace w1q28="0" if w1q28=="COVID-19 is not a health threat in general"
replace w1q28="99" if w1q28=="Unsure "

rename FamilyFriendCOVIDDiagnosis w1q29
label variable w1q29 "Do you believe you or someone in your household, a friend, or a coworker has been infected with COVID-19 at any time?"
replace w1q29="1" if w1q29=="No, I do not believe myself or an immediate family member has had COVID-19"
replace w1q29="2" if w1q29=="Yes, the symptoms were consistent with the virus but not confirmed by a test"
replace w1q29="3" if w1q29=="Yes, a medical test confirmed COVID-19"
replace w1q29="99" if w1q29=="Unsure "

rename EssentialWorkerinHousehold w1q22
label variable w1q22 "Are you or someone in your household considered an essential worker, such as a worker in the medical field, home care, manufacturing, the service industry, etc.?"
replace w1q22="1" if w1q22=="No"
replace w1q22="2" if w1q22=="Yes, someone in my household is"
replace w1q22="3" if w1q22=="Yes, I am"

rename MedicalResponsibility w1q23
label variable w1q23 "How many people, including yourself, do you have medical responsibility over such as children, a disabled or elderly relative, etc?"
replace w1q23="1" if w1q23=="1"
replace w1q23="2" if w1q23=="2"
replace w1q23="3" if w1q23=="3"
replace w1q23="4" if w1q23=="4"
replace w1q23="5" if w1q23=="More than 4"


//News Consumption

rename LocalTVnews NewsSource1
rename CNNcableTV NewsSource2
rename MSNBCcableTV NewsSource3
rename FOXNewscableTV NewsSource4
rename Radio NewsSource5
rename Facebook NewsSource6
rename Twitter NewsSource7
rename YouTube NewsSource8
rename Printandoronlinenewspapers NewsSource9
rename Otheronlinepublications NewsSource10
rename Friendsandfamily NewsSource11
rename IdontfollownewsrelatedtoC NewsSource12
rename BQ NewsSourceUnsure
rename BR NewsSourceOther


rename COVIDNewsConsumption w1q25 
label variable w1q25 "How often do you read, watch, or listen to news related to COVID-19?"
replace w1q25="1" if w1q25=="Once a month or less"
replace w1q25="2" if w1q25=="A few times a month"
replace w1q25="3" if w1q25=="Once a week"
replace w1q25="4" if w1q25=="Several times a week"
replace w1q25="5" if w1q25=="Once a day"
replace w1q25="6" if w1q25=="More than once a day"
replace w1q25="99" if w1q25=="Unsure "

rename CommunityGroupMembership w1q26
label variable w1q26 "Regardless of whether or not youâ€™re currently able to meet in person, are you an active member of a community organization such as a church group, a service organization, business organization, sports/recreation team, neighborhood association, or other similar group?"
replace w1q26="1" if w1q26=="No"
replace w1q26="2" if w1q26=="Yes"

gen test="."
replace test="1" if Group=="Test"
replace test="0" if Group=="Control"

rename Gender female
replace female="1" if female=="Female"
replace female="0" if female=="Male"
replace female="99" if female=="Other "

rename AgeRange age
replace age="1" if age=="18 - 34"
replace age="2" if age=="35 - 49"
replace age="3" if age=="50 - 64"
replace age="4" if age=="65 or older"

rename IncomebyResponse income4cat
replace income4cat="2" if income4cat=="$25,000 - $50,000"
replace income4cat="3" if income4cat=="$50,001 - $100,000"
replace income4cat="1" if income4cat=="Less than $25,000"
replace income4cat="4" if income4cat=="More than $100,000"

rename Income_Group income3cat
replace income3cat="1" if income3cat=="<$50k"
replace income3cat="2" if income3cat=="$50k-$99k"
replace income3cat="3" if income3cat=="$100k+"
replace income3cat="99" if income3cat=="Unknown"

rename Voter_Propensity voteProp
label variable voteProp "Voter Propensity"
replace voteProp="1" if voteProp=="Low"
replace voteProp="2" if voteProp=="Medium"
replace voteProp="3" if voteProp=="High"
replace voteProp="99" if voteProp=="Invalid Number. For input string: """

rename Education edu
replace edu="1" if edu=="High school or less"
replace edu="2" if edu=="Some college"
replace edu="3" if edu=="Bachelors degree or higher"
replace edu="99" if edu=="Unknown"

rename Marital_Status married
replace married="1" if married=="Married"
replace married="0" if married!="1"

rename PresenceOfChildrenCode kids
replace kids="0" if kids!="Yes"
replace kids="1" if kids=="Yes"

rename minute_diff minutes1

gen exclude1=0
replace exclude1=1 if test=="0" & minutes1<2  // 4 respondents 
replace exclude1=1 if test=="1" & minutes1<5  // 43 respondents

gen white=0
replace white=1 if Ethnicity=="White"
gen black=0
replace black=1 if Ethnicity=="Black"
gen asian=0
replace asian=1 if Ethnicity=="Asian"
gen hispanic=0
replace hispanic=1 if Ethnicity=="Hispanic/Latino"

gen wave1=1
	
destring _all, replace
 save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 1 Prelim Data.dta", replace



////////////////////////////////////////////////////////////////////////////////

// Wave 2

import excel "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 2.xlsx", sheet("Sheet1") firstrow clear

rename COVIDGeneralConcern w2q1
label variable w2q1 "How concerned are you that you or an immediate family member will be infected with COVID-19?"
replace w2q1="1" if w2q1=="Very unconcerned"
replace w2q1="2" if w2q1=="Somewhat unconcerned"
replace w2q1="3" if w2q1=="Neither concerned nor unconcerned"
replace w2q1="4" if w2q1=="Somewhat concerned"
replace w2q1="5" if w2q1=="Very concerned"
replace w2q1="99" if w2q1=="Unsure"

 
rename COVIDComplicationsConcern w2q2
label variable w2q2 "How concerned are you that you or an immediate family member will get serious complications and/or be hospitalized due to COVID-19?"
replace w2q2="1" if w2q2=="Very unconcerned"
replace w2q2="2" if w2q2=="Somewhat unconcerned"
replace w2q2="3" if w2q2=="Neither concerned nor unconcerned"
replace w2q2="4" if w2q2=="Somewhat concerned"
replace w2q2="5" if w2q2=="Very concerned"
replace w2q2="99" if w2q2=="Unsure"


rename LikelihoodNoSeatbelt w2q3
label variable w2q3 "Not wearing a seatbelt when being a passenger in the front seat."
replace w2q3="1" if w2q3=="Very Unlikely"
replace w2q3="2" if w2q3=="Unlikely"
replace w2q3="3" if w2q3=="Not Sure"
replace w2q3="4" if w2q3=="Likely"
replace w2q3="5" if w2q3=="Very Likely"
replace w2q3="99" if w2q3=="Prefer Not to Answer"

rename LikelihoodNoSunscreen w2q4
label variable w2q4 "Exposing yourself to the sun without using sunscreen."
replace w2q4="1" if w2q4=="Very Unlikely"
replace w2q4="2" if w2q4=="Unlikely"
replace w2q4="3" if w2q4=="Not Sure"
replace w2q4="4" if w2q4=="Likely"
replace w2q4="5" if w2q4=="Very Likely"
replace w2q4="99" if w2q4=="Prefer Not to Answer"



rename LikelihoodWhitewaterRafting w2q5
label variable w2q5 "Going whitewater rafting at high water in the spring"
replace w2q5="1" if w2q5=="Very Unlikely"
replace w2q5="2" if w2q5=="Unlikely"
replace w2q5="3" if w2q5=="Not Sure"
replace w2q5="4" if w2q5=="Likely"
replace w2q5="5" if w2q5=="Very Likely"
replace w2q5="99" if w2q5=="Prefer Not to Answer"



rename LikelihoodTravelwoReservat w2q6
label variable w2q6 "Going on a two-week vacation in a foreign country without booking accommodations ahead."
replace w2q6="1" if w2q6=="Very Unlikely"
replace w2q6="2" if w2q6=="Unlikely"
replace w2q6="3" if w2q6=="Not Sure"
replace w2q6="4" if w2q6=="Likely"
replace w2q6="5" if w2q6=="Very Likely"
replace w2q6="99" if w2q6=="Prefer Not to Answer"



rename LikelihoodPirateSoftware w2q7
label variable w2q7 "Illegally copying a piece of software."
replace w2q7="1" if w2q7=="Very Unlikely"
replace w2q7="2" if w2q7=="Unlikely"
replace w2q7="3" if w2q7=="Not Sure"
replace w2q7="4" if w2q7=="Likely"
replace w2q7="5" if w2q7=="Very Likely"
replace w2q7="99" if w2q7=="Prefer Not to Answer"



rename LikelihoodCheat w2q8
label variable w2q8 "Passing off somebody elseâ€™s work as your own."
replace w2q8="1" if w2q8=="Very Unlikely"
replace w2q8="2" if w2q8=="Unlikely"
replace w2q8="3" if w2q8=="Not Sure"
replace w2q8="4" if w2q8=="Likely"
replace w2q8="5" if w2q8=="Very Likely"
replace w2q8="99" if w2q8=="Prefer Not to Answer"



rename LikelihoodArgue w2q9
label variable w2q9 "Arguing with a friend about an issue on which he or she has a very different opinion."
replace w2q9="1" if w2q9=="Very Unlikely"
replace w2q9="2" if w2q9=="Unlikely"
replace w2q9="3" if w2q9=="Not Sure"
replace w2q9="4" if w2q9=="Likely"
replace w2q9="5" if w2q9=="Very Likely"
replace w2q9="99" if w2q9=="Prefer Not to Answer"



rename LikelihoodDefendUnpopularIs w2q10
label variable w2q10 "Defending an unpopular issue that you believe in at a social occasion."
replace w2q10="1" if w2q10=="Very Unlikely"
replace w2q10="2" if w2q10=="Unlikely"
replace w2q10="3" if w2q10=="Not Sure"
replace w2q10="4" if w2q10=="Likely"
replace w2q10="5" if w2q10=="Very Likely"
replace w2q10="99" if w2q10=="Prefer Not to Answer"


rename GASourceTrus w2q11
label variable w2q11 "I trust COVID-19-related news from official Georgia government sources, such as the Georgia Department of Public Health and the Governorâ€™s Office."
replace w2q11="1" if w2q11=="Strongly Disagree"
replace w2q11="2" if w2q11=="Somewhat Disagree"
replace w2q11="3" if w2q11=="Neither Agree Nor Disagree"
replace w2q11="4" if w2q11=="Somewhat Agree"
replace w2q11="5" if w2q11=="Strongly Agree"
replace w2q11="99" if w2q11=="Unsure"

rename ExpertSourceTrust w2q12
label variable w2q12 "I trust COVID-19-related news from official national government sources, such as the Centers for Disease Control (CDC) and the National Institutes of Health (NIH)."
replace w2q12="1" if w2q12=="Strongly Disagree"
replace w2q12="2" if w2q12=="Somewhat Disagree"
replace w2q12="3" if w2q12=="Neither Agree Nor Disagree"
replace w2q12="4" if w2q12=="Somewhat Agree"
replace w2q12="5" if w2q12=="Strongly Agree"
replace w2q12="99" if w2q12=="Unsure"

rename DontWorryifStrongImmuneSys w2q13
label variable w2q13 "People with strong immune systems do not need to worry about COVID-19."
replace w2q13="1" if w2q13=="Strongly Disagree"
replace w2q13="2" if w2q13=="Somewhat Disagree"
replace w2q13="3" if w2q13=="Neither Agree Nor Disagree"
replace w2q13="4" if w2q13=="Somewhat Agree"
replace w2q13="5" if w2q13=="Strongly Agree"
replace w2q13="99" if w2q13=="Unsure"

rename SameasFlu w2q14
label variable w2q14 "COVID-19 poses the same risk as the seasonal flu."
replace w2q14="1" if w2q14=="Strongly Disagree"
replace w2q14="2" if w2q14=="Somewhat Disagree"
replace w2q14="3" if w2q14=="Neither Agree Nor Disagree"
replace w2q14="4" if w2q14=="Somewhat Agree"
replace w2q14="5" if w2q14=="Strongly Agree"
replace w2q14="99" if w2q14=="Unsure"

rename DesiretoSociallyDistance w2q15
label variable w2q15 "During this pandemic, I wish people who are not a part of my household would stay at least six feet away from me."
replace w2q15="1" if w2q15=="Strongly Disagree"
replace w2q15="2" if w2q15=="Somewhat Disagree"
replace w2q15="3" if w2q15=="Neither Agree Nor Disagree"
replace w2q15="4" if w2q15=="Somewhat Agree"
replace w2q15="5" if w2q15=="Strongly Agree"
replace w2q15="99" if w2q15=="Unsure"

rename VaccineReaction w2q16
label variable w2q16 "Once a COVID-19 vaccine is available in the U.S., which of the following statements most closely matches what youâ€™ll do?"
replace w2q16="1" if w2q16=="I will not get the vaccine because COVID-19 is not a real danger"
replace w2q16="2" if w2q16=="I will get the vaccine eventually, but Iâ€™ll wait to make sure it is safe"
replace w2q16="3" if w2q16=="I will get the vaccine when I get around to it"
replace w2q16="4" if w2q16=="I will get the vaccine immediatelyÂ "
replace w2q16="88" if w2q16=="I will not get the vaccine because I donâ€™t think vaccines are safe in general"
replace w2q16="99" if w2q16=="Unsure"



rename FrequencyDiningOut w2q17  
label variable w2q17 "In the past month, how many times have you dined in a restaurant, bar, cafÃ©, etc?"
replace w2q17="1" if w2q17=="I have not dined out in the past month"
replace w2q17="2" if w2q17=="1 - 2 times in the past month"
replace w2q17="3" if w2q17=="3 - 6 times in the past month"
replace w2q17="4" if w2q17=="7 - 10 times in the past month"
replace w2q17="5" if w2q17=="More than 10 times in the past month"
replace w2q17="99" if w2q17=="Unsure"


rename FrequencyMask w2q18
label variable w2q18 "When out in public and around people, how often do you wear a mask or face covering?"
replace w2q18="1" if w2q18=="Never"
replace w2q18="2" if w2q18=="Rarely"
replace w2q18="3" if w2q18=="Some of the time"
replace w2q18="4" if w2q18=="Most of the time"
replace w2q18="5" if w2q18=="Always"
replace w2q18="99" if w2q18=="Unsure"

// Responses to why not wearing mask
rename WhyNoMask w2q19
label variable w2q19 "Which of the following reasons best describe why you donâ€™t regularly wear a mask or face covering? You may select up to three options."
rename WhyNoMaskOther w2q19b 
label variable w2q19b "Other text entry"

gen NoMask1W2=0
replace NoMask1W2=1 if w2q19=="Being forced to wear a mask violates my personal freedom"
gen NoMask2W2=0
replace NoMask2W2=1 if w2q19=="Masks are awkward/uncomfortable"
gen NoMask3W2=0
replace NoMask3W2=1 if w2q19=="Masks cannot protect me or stop the spread of COVID-19"
gen NoMask4W2=0
replace NoMask4W2=1 if w2q19=="There is little risk that I can contract or spread COVID-19"
gen NoMask5W2=0
replace NoMask5W2=1 if w2q19=="Wearing a mask is a greater threat to my health than COVID-19"
gen NoMaskUnsureW2=0
replace NoMaskUnsureW2=1 if w2q19=="Unsure"
gen NoMaskOtherW2=0
replace NoMaskOtherW2=1 if w2q19=="Other (please specify)"

rename FrequencySocialDistance w2q20
label variable w2q20 "When out in public and around people, how often do you socially distance by staying six or more feet away from others?"
replace w2q20="1" if w2q20=="Never"
replace w2q20="2" if w2q20=="Rarely"
replace w2q20="3" if w2q20=="Some of the time"
replace w2q20="4" if w2q20=="Most of the time"
replace w2q20="5" if w2q20=="Always"
replace w2q20="99" if w2q20=="Unsure"

// Responses to why not socially distancing
rename WhyNotSocialDistance w2q21
label variable w2q21 "Which of the following reasons best describe why you donâ€™t regularly socially distance by staying six or more feet away from others?' You may select up to three options."
rename WhyNotSocialDistanceOther w2q21b
label variable w2q21b "Other text entry" 

gen SocDis1W2=0
replace SocDis1W2=1 if w2q21=="Being forced to socially distance violates my personal freedom"
gen SocDis2W2=0
replace SocDis2W2=1 if w2q21=="Socially distancing cannot protect me or stop the spread of COVID-19"
gen SocDis3W2=0
replace SocDis3W2=1 if w2q21=="Socially distancing is awkward/uncomfortable"
gen SocDis4W2=0
replace SocDis4W2=1 if w2q21=="There is little risk that I can contract or spread COVID-19"
gen SocDisUnsureW2=0
replace SocDisUnsureW2=1 if w2q21=="Unsure"
gen SocDisOtherW2=0
replace SocDisOtherW2=1 if w2q21=="Other (please specify)"

rename FrequencyEncourageMaskSoc w2q22
label variable w2q22 "How often do you ask or encourage your family or friends to wear a mask and/or stay six feet away from others for their own safety?"
replace w2q22="1" if w2q22=="Never"
replace w2q22="2" if w2q22=="Rarely"
replace w2q22="3" if w2q22=="Some of the time"
replace w2q22="4" if w2q22=="Most of the time"
replace w2q22="5" if w2q22=="Always"
replace w2q22="99" if w2q22=="Unsure"

rename HowManyinMasksSocialDista w2q23
label variable w2q23 "Generally, when you are in public how many of the people around you are wearing masks and/or social distancing by staying at least six feet away from others?"
replace w2q23="1" if w2q23=="Practically no one "
replace w2q23="2" if w2q23=="Some people, but less than half"
replace w2q23="3" if w2q23=="Not everyone, but more than half"
replace w2q23="4" if w2q23=="Practically everyone"
replace w2q23="88" if w2q23=="I never go out"
replace w2q23="99" if w2q23=="Unsure"

rename ShoppingChange w2q24
label variable w2q24 "Which of the following statements most closely reflects how your shopping habits have changed due to COVID-19, if at all?"
replace w2q24="1" if w2q24=="I go to the store less often"
replace w2q24="2" if w2q24=="My shopping habits haven’t changed – I go to the store the same amount"
replace w2q24="3" if w2q24=="I go to the store more often"
replace w2q24="99" if w2q24=="Unsure"

rename VideoImpact w2q25  // Attention check -- No incorrect answers, and thus excluded
label variable w2q25 "What information do you recall from the video?"

rename Ideology w2q28
label variable w2q28 "And thinking about your views toward politics and government, would you say you areâ€¦"
replace w2q28="1" if w2q28=="Very liberal"
replace w2q28="2" if w2q28=="Liberal"
replace w2q28="3" if w2q28=="Moderate"
replace w2q28="4" if w2q28=="Somewhat conservative"
replace w2q28="5" if w2q28=="Very conservative"
replace w2q28="99" if w2q28=="Unsure"

rename InformedCOVIDThreat17 w2q30
label variable w2q30 "On a scale of 1 - 7, with 1 being an insignificant risk, and 7 being a serious risk, how much of a health risk is COVID-19 to you, or someone close to you?"
replace w2q30="0" if w2q30=="COVID-19 is not a health threat in general"
replace w2q30="99" if w2q30=="Unsure"

rename FamilyFriendCOVIDDiagnosis w2q31
label variable w2q31 "Do you believe you or someone in your household, a friend, or a coworker has been infected with COVID-19 at any time?"
replace w2q31="1" if w2q31=="No, I do not believe myself or an immediate family member has had COVID-19"
replace w2q31="2" if w2q31=="Yes, the symptoms were consistent with the virus but not confirmed by a test"
replace w2q31="3" if w2q31=="Yes, a medical test confirmed COVID-19"
replace w2q31="99" if w2q31=="Unsure"

gen test="."
replace test="0" if Mode=="Control"
replace test="1" if Mode=="Test"

rename Minutes minutes2

gen exclude2=0
replace exclude2=1 if Mode=="Control" & minutes2<2 // 3 respondents
replace exclude2=1 if Mode=="Test" & minutes2<5 // 16 respondents

gen wave2=2

destring _all, replace
save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 2 Prelim Data.dta", replace


import excel "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 3.xlsx", sheet("Sheet1") firstrow clear

rename COVIDGeneralConcern w3q1

label variable w3q1 "How concerned are you that you or an immediate family member will be infected with COVID-19?"
replace w3q1="1" if w3q1=="Very unconcerned"
replace w3q1="2" if w3q1=="Somewhat unconcerned"
replace w3q1="3" if w3q1=="Neither concerned nor unconcerned"
replace w3q1="4" if w3q1=="Somewhat concerned"
replace w3q1="5" if w3q1=="Very concerned"
replace w3q1="99" if w3q1=="Unsure"

rename COVIDComplicationsConcern w3q2

label variable w3q2 "How concerned are you that you or an immediate family member will get serious complications and/or be hospitalized due to COVID-19?"
replace w3q2="1" if w3q2=="Very unconcerned"
replace w3q2="2" if w3q2=="Somewhat unconcerned"
replace w3q2="3" if w3q2=="Neither concerned nor unconcerned"
replace w3q2="4" if w3q2=="Somewhat concerned"
replace w3q2="5" if w3q2=="Very concerned"
replace w3q2="99" if w3q2=="Unsure"

rename PeopleCanbeTrusted w3q3
label variable w3q3 "would you say that most people can be trusted, or that you canâ€™t be too careful in dealing with people?"
replace w3q3="2" if w3q3=="Depends"
replace w3q3="3" if w3q3=="Most people can be trusted"
replace w3q3="99" if w3q3=="Unsure"
replace w3q3="1" if w3q3!="2" & w3q3!="3" & w3q3!="99" 


rename PeopleTrytobeFair w3q4
label variable w3q4 "Do you think that most people would try to take advantage of you if they got a chance, or would they try to be fair?"
replace w3q4="1" if w3q4=="Would take advantage"
replace w3q4="2" if w3q4=="Depends"
replace w3q4="3" if w3q4=="Would try to be fair"
replace w3q4="99" if w3q4=="Unsure" 


rename PeopleareHelpful w3q5
label variable w3q4 "Would you say that most of the time people try to be helpful, or are they mostly looking out for themselves?"
replace w3q5="1" if w3q5=="Just look out for themselves"
replace w3q5="2" if w3q5=="Depends"
replace w3q5="3" if w3q5=="Try to be helpful"
replace w3q5="99" if w3q5=="Unsure"



rename DontWorryifStrongImmuneSys w3q6
label variable w3q6 "People with strong immune systems do not need to worry about COVID-19."
replace w3q6="1" if w3q6=="Strongly disagree"
replace w3q6="2" if w3q6=="Somewhat disagree"
replace w3q6="3" if w3q6=="Neither agree nor disagree"
replace w3q6="4" if w3q6=="Somewhat agree"
replace w3q6="5" if w3q6=="Strongly agree"
replace w3q6="99" if w3q6=="Unsure"

rename SameasFlu w3q7
label variable w3q7 "COVID-19 poses the same risk as the seasonal flu."
replace w3q7="1" if w3q7=="Strongly disagree"
replace w3q7="2" if w3q7=="Somewhat disagree"
replace w3q7="3" if w3q7=="Neither agree nor disagree"
replace w3q7="4" if w3q7=="Somewhat agree"
replace w3q7="5" if w3q7=="Strongly agree"
replace w3q7="99" if w3q7=="Unsure"

rename COVIDVaccine w3q8
label variable w3q8 "There will be a widely available vaccine for COVID-19 by the end of the year."
replace w3q8="1" if w3q8=="Strongly disagree"
replace w3q8="2" if w3q8=="Somewhat disagree"
replace w3q8="3" if w3q8=="Neither agree nor disagree"
replace w3q8="4" if w3q8=="Somewhat agree"
replace w3q8="5" if w3q8=="Strongly agree"
replace w3q8="99" if w3q8=="Unsure"

rename DesiretoSociallyDistance w3q9
label variable w3q9 "During this pandemic, I wish people who are not a part of my household would stay at least six feet away from me."
replace w3q9="1" if w3q9=="Strongly disagree"
replace w3q9="2" if w3q9=="Somewhat disagree"
replace w3q9="3" if w3q9=="Neither agree nor disagree"
replace w3q9="4" if w3q9=="Somewhat agree"
replace w3q9="5" if w3q9=="Strongly agree"
replace w3q9="99" if w3q9=="Unsure"

rename VaccineReaction w3q10
label variable w3q10 "Once a COVID-19 vaccine is available in the U.S., which of the following statements most closely matches what youâ€™ll do?"
replace w3q10="1" if w3q10=="I will not get the vaccine because COVID-19 is not a real danger"
replace w3q10="2" if w3q10=="I will get the vaccine eventually, but Iâ€™ll wait to make sure it is safe"
replace w3q10="3" if w3q10=="I will get the vaccine when I get around to it"
replace w3q10="4" if w3q10=="I will get the vaccine immediatelyÂ "
replace w3q10="88" if w3q10=="I will not get the vaccine because I donâ€™t think vaccines are safe in general"
replace w3q10="99" if w3q10=="Unsure"

rename FrequencyLargeGroupEvent w3q11
label variable w3q11 "In the past month, how many times have you attended a group event with more than 10 people in attendance, such as a religious gathering, party, funeral, wedding, sporting event, etc.?"
replace w3q11="1" if w3q11=="I have not attended a group event with more than 10 people in attendance in the past two weeks"
replace w3q11="2" if w3q11=="1 - 2 times in the past two weeks"
replace w3q11="3" if w3q11=="3 - 4 times in the past two weeks"
replace w3q11="4" if w3q11=="More than 5 times in the past two weeks"
replace w3q11="99" if w3q11=="Unsure"

rename FrequencyDiningOut w3q12
label variable w3q12 "In the past two weeks, how many times have you dined in a restaurant, bar, cafÃ©, etc?"
replace w3q12="1" if w3q12=="I have not dined out in the past two weeks"
replace w3q12="2" if w3q12=="1 - 2 times in the past two weeks"
replace w3q12="3" if w3q12=="3 - 4 times in the past two weeks"
replace w3q12="4" if w3q12=="More than 5 times in the past two weeks"
replace w3q12="99" if w3q12=="Unsure"


rename FrequencyMask w3q13
label variable w3q13 "When out in public and around people, how often do you wear a mask or face covering?"
replace w3q13="1" if w3q13=="Never"
replace w3q13="2" if w3q13=="Rarely"
replace w3q13="3" if w3q13=="Some of the time"
replace w3q13="4" if w3q13=="Most of the time"
replace w3q13="5" if w3q13=="Always"
replace w3q13="99" if w3q13=="Unsure"


rename WhyNoMask w3q14
label variable w3q14 "Which of the following reasons best describe why you donâ€™t regularly wear a mask or face covering? You may select up to three options."

gen NoMask1W3=0
replace NoMask1W3=1 if w3q14=="Being forced to wear a mask violates my personal freedom"
gen NoMask2W3=0
replace NoMask2W3=1 if w3q14=="Masks are awkward/uncomfortable"
gen NoMask3W3=0
replace NoMask3W3=1 if w3q14=="Masks cannot protect me or stop the spread of COVID-19"
gen NoMask4W3=0
replace NoMask4W3=1 if w3q14=="There is little risk that I can contract or spread COVID-19"
gen NoMask5W3=0
replace NoMask5W3=1 if w3q14=="Wearing a mask is a greater threat to my health than COVID-19"
gen NoMaskUnsureW3=0
replace NoMaskUnsureW3=1 if w3q14=="Unsure"
gen NoMaskOtherW3=0
replace NoMaskOtherW3=1 if w3q14=="Other (please specify)"

rename WhyNoMaskOther w3q14b
label variable w3q14b "Other text entry"

rename FrequencySocialDistance w3q15
label variable w3q15 "When out in public and around people, how often do you socially distance by staying six or more feet away from others?"
replace w3q15="1" if w3q15=="Never"
replace w3q15="2" if w3q15=="Rarely"
replace w3q15="3" if w3q15=="Some of the time"
replace w3q15="4" if w3q15=="Most of the time"
replace w3q15="5" if w3q15=="Always"
replace w3q15="99" if w3q15=="Unsure"

rename WhyNotSocialDistance w3q16
label variable w3q16 "Which of the following reasons best describe why you donâ€™t regularly socially distance by staying six or more feet away from others?' You may select up to three options."

gen SocDis1W3=0
replace SocDis1W3=1 if w3q16=="Being forced to socially distance violates my personal freedom"
gen SocDis2W3=0
replace SocDis2W3=1 if w3q16=="Socially distancing cannot protect me or stop the spread of COVID-19"
gen SocDis3W3=0
replace SocDis3W3=1 if w3q16=="Socially distancing is awkward/uncomfortable"
gen SocDis4W3=0
replace SocDis4W3=1 if w3q16=="There is little risk that I can contract or spread COVID-19"
gen SocDisUnsureW3=0
replace SocDisUnsureW3=1 if w3q16=="Unsure"
gen SocDisOtherW3=0
replace SocDisOtherW3=1 if w3q16=="Other (please specify)"


rename WhyNotSocialDistanceOther w3q16b

rename FrequencyEncourageMaskSoc w3q17
label variable w3q17 "How often do you ask or encourage your family or friends to wear a mask and/or stay six feet away from others for their own safety?"
replace w3q17="1" if w3q17=="Never"
replace w3q17="2" if w3q17=="Rarely"
replace w3q17="3" if w3q17=="Some of the time"
replace w3q17="4" if w3q17=="Most of the time"
replace w3q17="5" if w3q17=="Always"
replace w3q17="99" if w3q17=="Unsure"

rename HowManyinMasksSocialDista w3q18
label variable w3q18 "Generally, when you are in public how many of the people around you are wearing masks and/or social distancing by staying at least six feet away from others?"
replace w3q18="1" if w3q18=="Practically no one "
replace w3q18="2" if w3q18=="Some people, but less than half"
replace w3q18="3" if w3q18=="Not everyone, but more than half"
replace w3q18="4" if w3q18=="Practically everyone"
replace w3q18="88" if w3q18=="I never go out"
replace w3q18="99" if w3q18=="Unsure"

rename GovMurdersCitizens w3q19
label variable w3q19 "The government is involved in the murder of innocent citizens and/or well-known public figures, and keeps this a secret."
replace w3q19="1" if w3q19=="Definitely not true"
replace w3q19="2" if w3q19=="Probably not true"
replace w3q19="3" if w3q19=="Not sure/cannot decide"
replace w3q19="4" if w3q19=="Probably true"
replace w3q19="5" if w3q19=="Definitely true"
replace w3q19="99" if w3q19=="Unsure"

rename Illuminati w3q20
label variable w3q20 "The power held by heads of state is second to that of small unknown groups who really control world politics."
replace w3q20="1" if w3q20=="Definitely not true"
replace w3q20="2" if w3q20=="Probably not true"
replace w3q20="3" if w3q20=="Not sure/cannot decide"
replace w3q20="4" if w3q20=="Probably true"
replace w3q20="5" if w3q20=="Definitely true"
replace w3q20="99" if w3q20=="Unsure"

rename ScientistsLie w3q21
label variable w3q21 "Groups of scientists manipulate, fabricate, or suppress evidence in order to deceive the public."
replace w3q21="1" if w3q21=="Definitely not true"
replace w3q21="2" if w3q21=="Probably not true"
replace w3q21="3" if w3q21=="Not sure/cannot decide"
replace w3q21="4" if w3q21=="Probably true"
replace w3q21="5" if w3q21=="Definitely true"
replace w3q21="99" if w3q21=="Unsure"

rename SecretGovTerrorismWithinUS w3q22
label variable w3q22 "The government permits or perpetrates acts of terrorism on its own soil, disguising its involvement."
replace w3q22="1" if w3q22=="Definitely not true"
replace w3q22="2" if w3q22=="Probably not true"
replace w3q22="3" if w3q22=="Not sure/cannot decide"
replace w3q22="4" if w3q22=="Probably true"
replace w3q22="5" if w3q22=="Definitely true"
replace w3q22="99" if w3q22=="Unsure"

rename GovHidingProofofAliens w3q23
label variable w3q23 "Evidence of alien contact is being concealed from the public."
replace w3q23="1" if w3q23=="Definitely not true"
replace w3q23="2" if w3q23=="Probably not true"
replace w3q23="3" if w3q23=="Not sure/cannot decide"
replace w3q23="4" if w3q23=="Probably true"
replace w3q23="5" if w3q23=="Definitely true"
replace w3q23="99" if w3q23=="Unsure"

rename SuppressedTech w3q24
label variable w3q24 "New and advanced technology which would harm current industry is being suppressed."
replace w3q24="1" if w3q24=="Definitely not true"
replace w3q24="2" if w3q24=="Probably not true"
replace w3q24="3" if w3q24=="Not sure/cannot decide"
replace w3q24="4" if w3q24=="Probably true"
replace w3q24="5" if w3q24=="Definitely true"
replace w3q24="99" if w3q24=="Unsure"

rename GovUsesPatsies w3q25
label variable w3q25 "The government uses people as patsies to hide its involvement in criminal activity."
replace w3q25="1" if w3q25=="Definitely not true"
replace w3q25="2" if w3q25=="Probably not true"
replace w3q25="3" if w3q25=="Not sure/cannot decide"
replace w3q25="4" if w3q25=="Probably true"
replace w3q25="5" if w3q25=="Definitely true"
replace w3q25="99" if w3q25=="Unsure"

rename PoliticiansHideImportantInfo w3q26
label variable w3q26 "A lot of important information is deliberately concealed from the public out of self-interest."
replace w3q26="1" if w3q26=="Definitely not true"
replace w3q26="2" if w3q26=="Probably not true"
replace w3q26="3" if w3q26=="Not sure/cannot decide"
replace w3q26="4" if w3q26=="Probably true"
replace w3q26="5" if w3q26=="Definitely true"
replace w3q26="99" if w3q26=="Unsure"

rename InformedCOVIDThreat17 w3q27
label variable w3q27 "On a scale of 1 - 7, with 1 being an insignificant risk, and 7 being a serious risk, how much of a health risk is COVID-19 to you, or someone close to you?"
replace w3q27="0" if w3q27=="COVID-19 is not a health threat in general"
replace w3q27="99" if w3q27=="Unsure"

rename FamilyFriendCOVIDDiagnosis w3q31
label variable w3q31 "Do you believe you or someone in your household, a friend, or a coworker has been infected with COVID-19 at any time?"
replace w3q31="1" if w3q31=="No, I do not believe myself or an immediate family member has had COVID-19"
replace w3q31="2" if w3q31=="Yes, the symptoms were consistent with the virus but not confirmed by a test"
replace w3q31="3" if w3q31=="Yes, a medical test confirmed COVID-19"
replace w3q31="99" if w3q31=="Unsure"


rename Gender female
replace female="1" if female=="Female"
replace female="0" if female=="Male"
replace female="99" if female=="Other"

rename AgeRange age
replace age="1" if age=="18 - 34"
replace age="2" if age=="35 - 49"
replace age="3" if age=="50 - 64"
replace age="4" if age=="65 or older"

rename IncomebyResponse income4cat
replace income4cat="2" if income4cat=="$25,000 - $50,000"
replace income4cat="3" if income4cat=="$50,001 - $100,000"
replace income4cat="1" if income4cat=="Less than $25,000"
replace income4cat="4" if income4cat=="More than $100,000"

gen test="."
replace test="0" if Group=="Control"
replace test="1" if Group=="Test"

rename Minutes minutes3

gen exclude3=0
replace exclude3=1 if Group=="Control" & minutes3<2 // 1 respondent 
replace exclude3=1 if Group=="Test" & minutes3<2 // 0 respondents 

gen wave3=3	
	
destring _all, replace

save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 3 Prelim Data.dta", replace





use "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 1 Prelim Data.dta", clear
merge m:m UID using "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 2 Prelim Data.dta"
rename _merge merge1
merge m:m UID using "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Wave 3 Prelim Data.dta"
rename _merge merge2

drop if exclude1==1 // 47 observations dropped
drop if exclude2==2 // 0 observations dropped
drop if exclude3==3 // 0 observations dropped

save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Prelim Cleaned Data.dta", replace       
use "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Prelim Cleaned Data.dta", clear

// Conspiratorial Ideation Battery

replace w3q19=.  if w3q19==99
replace w3q20=.  if w3q20==99
replace w3q21=.  if w3q21==99
replace w3q22=.  if w3q22==99
replace w3q23=.  if w3q23==99
replace w3q24=.  if w3q24==99
replace w3q25=.  if w3q25==99
replace w3q26=.  if w3q26==99 

gen conspir=((w3q19+w3q20+w3q21+w3q22+w3q23+w3q24+w3q25+w3q26)/8) 
label variable conspir "Conspiratorial Thinking Battery"

// Institutional Trust 

replace w2q11=. if w2q11==99
replace w2q12=. if w2q12==99 // 1 observation dropped

rename w2q11 instiTrustGeorgia
rename w2q12 instiTrustNational

// Demographics

gen nonwhite=.
replace nonwhite=1 if white==0
replace nonwhite=0 if white==1

rename income4cat income

replace edu=. if edu==99
replace female=. if female==99

// Ideology
tab Ideology
rename Ideology ideo
replace ideo="1" if ideo=="Very liberal"
replace ideo="2" if ideo=="Liberal"
replace ideo="3" if ideo=="Moderate"
replace ideo="4" if ideo=="Somewhat conservative"
replace ideo="5" if ideo=="Very conservative"
replace ideo="." if ideo=="Unsure"
tab ideo
destring ideo, replace


// Personal Experience with COVID-19
gen exper=w1q29
replace exper=. if exper==99

// Creating the Behavior Measure through factor analysis

// Non responses 

replace w1q12=. if w1q12==99
replace w1q14=. if w1q14==99
replace w1q16=. if w1q16==99

tab w1q12 // masking
tab w1q14 // social distancing
tab w1q16 // encouraging

corr w1q12 w1q14 w1q16 if w1q12!=99 & w1q14!=99 & w1q16!=99 

factor w1q12 w1q14 w1q16 if w1q12!=99 & w1q14!=99 & w1q16!=99, factor(1) 
rotate
predict BehaveFactor

corr BehaveFactor w1q12 w1q14 w1q16 if w1q12!=99 & w1q14!=99 & w1q16!=99


// Individual Behavior Measuring: Frequency of masking, social distancing 
// and encouraging others to social distance

rename w1q12 masking
rename w1q14 distancing 
rename w1q16 encouraging


save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Cleaned Data.dta", replace

// Mediation analysis 

/* 
*** Outcomes ***

BehaveFactor -- 
 
*** Mediating ***

instiTrustGeorgia, instiTrustNational 
 
*** Explanatory *** 

conspir

*/

sem(instiTrustGeorgia <- conspir) /// 
	(BehaveFactor <- instiTrustGeorgia conspir), nocapslatent

medsem, indep(conspir) med(instiTrustGeorgia) dep(BehaveFactor) rit rid 

estat teffects

sem(instiTrustNational <- conspir) ///
	(BehaveFactor <- instiTrustNational  conspir), nocapslatent

medsem, indep(conspir) med(instiTrustNational) dep(BehaveFactor) rit rid 

estat teffects

keep masking distancing encouraging BehaveFactor conspir ///
		instiTrustGeorgia instiTrustNational ///
		age income edu nonwhite female ideo exper UID 
		
save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Cleaned Data.dta", replace

// Creation of marginal effect plots

reg BehaveFactor c.instiTrustGeorgia##c.conspir,  vce(hc3)
margins, at(instiTrustGeorgia=(1(1)5) conspir=(1(2)5))
marginsplot, scheme(s1mono) ytitle("Predicted Behaviors") title("") ysc(range(-2 1)) ylabel(-2 -1 0 1)  xtitle("Institutional Trust: State")  ///
	plot( , label("Conspiratorial=1" "Conspiratorial=3" "Conspiratorial=5")) 
graph export "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Interaction Effect of Conspiratorial Ideation and State Trust on Behaviors.png", as(png) replace

reg BehaveFactor c.instiTrustNational##c.conspir, vce(hc3)
margins, at(instiTrustNational=(1(1)5) conspir=(1(2)5))
marginsplot, scheme(s1mono) ytitle("Predicted Behaviors") title("") ysc(range(-2 1)) ylabel(-2 -1 0 1) xtitle("Institutional Trust: National") ///
	plot( , label("Conspiratorial=1" "Conspiratorial=3" "Conspiratorial=5")) 
graph export "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Interaction Effect of Conspiratorial Ideation and National Trust on Behaviors.png", as(png) replace

save "C:\Users\evanl\Desktop\Data Availability for COVID PS Article\Cleaned Data.dta", replace
